import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import { errorRoutes } from './error'
import { testRoutes } from './test'
import { linkRoutes } from './link'
import { workRoutes } from './work'
import { studyRoutes } from './study'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/exam',
      component: () => import('../views/ExamView.vue'),
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue'),
    },
  ].concat(errorRoutes, testRoutes, linkRoutes, workRoutes, studyRoutes),
})
// concat合并数组
export default router
